<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%><html>
<head>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.alphanumeric.js"></script>
<script language="javascript">
	$().ready(function(){

		$("#mobile").numeric();
		
		$("#codeTip").hide();
		$("#mobileTip").hide();

		$("#iv").attr("src","<%=ServerValue.getFrontContextPath()%>/servlet/imageValid.jpg?"+Math.random());
		
		if("${actionResult}" == "code_error"){
			$("#codeTip").html("验证码错误");
			$("#codeTip").show();
		}

		if("${actionResult}" == "mobile_not_match"){
			$("#mobileTip").html("帐户名与注册手机不匹配");
			$("#mobileTip").show();
		}
		
		$("#submit_data").click(function(){
			var isCorrect = true;

			$("#codeTip").hide();
			$("#mobileTip").hide();
				
			if($("#mobile").attr('value') == ""){
				$("#mobileTip").html("请输入手机");
				$("#mobileTip").show();
				isCorrect = false;
			}else if($("#mobile").val().length != 11){
				$("#mobileTip").html("手机号码格式不正确");
				$("#mobileTip").show();
				isCorrect = false;
			}
				
			if(($("#ccode").attr('value') == "")){
				$("#codeTip").html("请输入验证码");
				$("#codeTip").show();
				isCorrect = false;
			}
			if(isCorrect){
				$("#sendpwdForm").submit();
				return false;
			}
		});
		
		$("#chang_image").click(function(){
			$("#iv").attr("src","<%=ServerValue.getFrontContextPath()%>/servlet/imageValid.jpg?"+Math.random());
		});
	});
</script>
</head>
<body>
  <div id="main" class="member-reg">
  	<h3>找回密码</h3>
    <div class="m-regform">
   	   <p class="pointmsg">请输入注册时所填写的手机，我们会发送一则带有校验码的验证短信到您的手机。</p>
   	   <s:form action="sendforgetpwd.do" method="post" id="sendpwdForm">
   	   <INPUT type="hidden" size="20" name="loginID" id="loginID" value="${loginID}" />
   	  <ul style="margin-left:120px;">
     	 <li><div><label>手机：</label></div><div><input type="text" size="20" name="mobile" id="mobile" value="${mobile}" maxlength="11" /><br /><span id="mobileTip" class="msg rn">帐户名与注册手机不匹配</span></div></li>
     	 <li><div><label>验证码：</label></div><div><input type="text" size="20" name="ccode" id="ccode" maxlength="6" autocomplete="off"/><br /><img id="iv" name="iv"> 看不清？<a href="#" id="chang_image">换张图片</a><br /><span id="codeTip" class="msg rn">请输入校验码</span></div></li>
      </ul>
      </s:form>
        <p align="center">&nbsp;</p>
        <p align="center"><a href="javascript:;" id="submit_data" class="btn-mid">确定</a></p></div>
  </div>
</body>
</html>